<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
  
  <head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" th:href="@{/pages/favicon.ico}" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" th:href="@{/pages/css/font.css}" href="./css/font.css">
    <link rel="stylesheet" th:href="@{/pages/css/xadmin.css}" href="./css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="./lib/layui/layui.js" th:src="@{/pages/lib/layui/layui.js}" charset="utf-8"></script>
    <script type="text/javascript" th:src="@{/pages/js/xadmin.js}" src="./js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  
  <body>
    <div class="x-body">
      <div class="layui-row">
      </div>
      <xblock>
        <span class="x-right" style="line-height:40px">共有数据：<span th:text="${#lists.size(platformschemeList)}"></span> 条</span>
      </xblock>

      <table class="layui-table">
        <thead>
          <tr>
            <th>
              <div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i class="layui-icon">&#xe605;</i></div>
            </th>
            <th>计划名称</th>
            <th>投资区间</th>
            <th>返利</th>
            <th>可用平台红包</th>
            <th>平台利息</th>
            <th>总收益</th>
            <th>操作</th>
            </tr>
        </thead>
        <tbody>
          <tr th:each="scheme:${platformschemeList}">
            <td>
              <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='2'><i class="layui-icon">&#xe605;</i></div>
            </td>
            <td th:text="${scheme?.projectName}"></td>
            <td th:text="${scheme?.invesBelong}"></td>
            <td th:text="${scheme?.investRebate}"></td>
            <td th:text="${scheme?.usedRed=='0'?'是':'否'}"></td>
            <td th:text="${scheme?.platformInterest}"></td>
            <td th:text="${scheme?.earning}"></td>
            <td>
              <a title="删除" th:attr="aid=${scheme?.id}" onclick="scheme_del(this)" href="javascript:;">
                <i class="layui-icon">&#xe640;</i>
              </a>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <script th:inline="javascript">

      function scheme_del(obj){
          layer.confirm('确认要删除吗？',function(index){
              //发异步删除数据
              var aid = $(obj).attr("aid");
              $.post("/manage/platformscheme/delete?id="+aid,"",function (result,status,jqxhr) {
                  if(jqxhr.status==200){
                      layer.msg(result,{icon:1,time:1000},function () {
                          location.replace(location.href);
                      });
                  }else{
                      layer.msg(result,{icon:2,time:1000});
                  }
              });

          });
      }

    </script>
  </body>

</html>